from time import sleep
import importlib
import testClient
from watcher import ModuleWatcher
import logging
import imagePool

watcherList = [
    'testClient'
]

if __name__ == '__main__':
    FORMAT = '[%(levelname)-5s]%(asctime)-8s %(filename)s:%(lineno)d %(message)s'
    DATEFORMAT = '%H:%M:%S'
    logging.basicConfig(level=logging.DEBUG, format=FORMAT, datefmt=DATEFORMAT)

    moduleWatcher = ModuleWatcher()
    for module in watcherList:
        moduleWatcher.watch_module(module)
    moduleWatcher.start_watching()

    while 1:
        sleep(1)
        try:
            print(testClient.calcu(10))
        except Exception as e:
            print(e)
